/* const cache = {};

cache["foo"] = Math.random();
cache["foo"] = "123";
console.log(cache); */

// symbol: 独一无二
/* const s = Symbol();
console.log(s, typeof s, Symbol() === Symbol());
console.log(Symbol("foo"));
console.log(Symbol("baz"));
console.log(Symbol("bar")); */

/* const obj = {};
obj[Symbol()] = "123";
obj[Symbol()] = "456";
console.log(obj);
 */

const obj = {
  [Symbol()]: 123,
};
console.log(obj);

// 对象私有属性
const name = Symbol();
const person = {
  [name]: "zce",
  say() {
    console.log(this[name]);
  },
};
person.say();
